import "package:flutter/material.dart";

// 底部导航栏
class UseBottomBar extends StatefulWidget {
  const UseBottomBar({super.key});
  @override
  State<StatefulWidget> createState() {
    return UseBottomBarState();
  }
}

class UseBottomBarState extends State<UseBottomBar> {
  var _currentIndex = 0;
  @override
  Widget build(BuildContext context) {
    return BottomNavigationBar(
        type: BottomNavigationBarType.fixed,
        selectedItemColor: Colors.blue,
        unselectedItemColor: Colors.black,
        selectedFontSize: 12,
        unselectedFontSize: 12,
        showUnselectedLabels: true,
        currentIndex: _currentIndex,
        onTap: (index) {
          setState(() {
            _currentIndex = index;
          });
        },
        items: const [
          BottomNavigationBarItem(
              icon: Icon(
                Icons.home,
              ),
              label: "你好"),
          BottomNavigationBarItem(
              icon: Icon(
                Icons.abc,
              ),
              label: "美食"),
          BottomNavigationBarItem(
              icon: Icon(
                Icons.baby_changing_station,
              ),
              label: "起飞"),
          BottomNavigationBarItem(
              icon: Icon(
                Icons.cabin,
              ),
              label: "怎么"),
        ]);
  }
}
